package com.qf.ssm.mapper;

import com.qf.ssm.pojo.Menu;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import javax.swing.*;
import java.util.List;

public interface MenuMapper {


    @Insert("INSERT INTO menu(name,url,type,sort)values(#{name},#{url},#{type},#{sort})")
    void addMenu(Menu menu);

    @Update("UPDATE menu SET url=#{url} WHERE id=#{id}")
    void updateMenu(Menu menu);


    @Update("UPDATE menu set type='0'&&type='1' WHERE id in")
    void deleteMenuByIds(@Param("ids") List<Long> ids);

    @Select(" SELECT * FROM menu" )
    List<Menu>getAllMenu();




}
